@import '../../../themes/basic/base-all.less';

ti-modal-wrapper {
  --ti-modal-width: 550px;
}

// Container that the modal scrolls within
.ti3-modal {
  /* Positioning */
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: @zindex-modal;

  /* Display & Box Model */
  .box-sizing(border-box);
  overflow: hidden;

  /* Other */
  -webkit-overflow-scrolling: touch;
  // Prevent Chrome on Windows from adding a focus outline.
  outline: 0;
  font-size: var(--ti-common-font-size-base);
  font-weight: var(--ti-common-font-weight-4);
}

.ti3-modal-open .ti3-modal {
  overflow-x: hidden;
  overflow-y: auto;
}

// Shell div to position the modal with bottom padding
.ti3-modal-dialog {
  position: relative;
  .box-sizing(border-box);
  width: auto;
  margin: 10px;
}

// Actual modal
.ti3-modal-content {
  position: relative;
  .box-sizing(border-box);
  .border-radius(var(--ti-common-border-radius-normal));
  background-color: var(--ti-common-color-bg-white-normal);
  //更改阴影颜色
  .box-shadow(var(--ti-common-shadow-4-down));
  background-clip: padding-box;
  // Remove focus outline from opened modal
  outline: 0;
}

// Modal header
.ti3-modal-header {
  /* Display & Box Model */
  .box-sizing(border-box);
  padding: var(--ti-common-space-8x) var(--ti-common-space-8x) var(--ti-common-space-7x);
  color: var(--ti-common-color-text-primary);
  font-size: var(--ti-common-font-size-3);
  font-weight: var(--ti-common-font-weight-7);
  line-height: 100%;
  display: block;
  &.ti3-modal-title-center {
    text-align: center;
  }
}

.ti3-modal-close {
  position: absolute;
  top: var(--ti-common-space-2x);
  right: var(--ti-common-space-5x);
  .box-sizing(border-box);
  color: var(--ti-common-color-icon-normal);
  cursor: pointer;
  font: normal normal normal var(--ti-common-size-3x) / var(--ti-common-size-9x) ti3Font;
  text-transform: none;
  text-rendering: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  &:hover {
    color: var(--ti-common-color-icon-hover);
  }
}

// Modal body(sibling of .modal-header and .modal-footer)
.ti3-modal-body {
  position: relative;
  overflow-y: auto;
  .box-sizing(border-box);
  display: block;
  padding: var(--ti-common-space-0) var(--ti-common-space-8x);
}

// Footer (for actions)
.ti3-modal-footer {
  padding: var(--ti-common-space-7x) var(--ti-common-space-8x) var(--ti-common-space-8x);
  text-align: center; // center align buttons
  display: block;

  & button:nth-of-type(2) {
    margin-left: var(--ti-common-space-10); // 默认与HEC规范保持一致
  }
}

// Scale up the modal
@media screen and (min-width: 768px) {
  // Automatically set modal's width for larger viewports
  .ti3-modal-dialog {
    width: var(--ti-modal-width);
    margin: 150px auto 0;
  }
}
